<%@ page import="institutional.Department" %>



			<div class="control-group fieldcontain ${hasErrors(bean: departmentInstance, field: 'code', 'error')} required">
				<label for="code" class="control-label"><g:message code="department.code.label" default="Code" /><span class="required-indicator">*</span></label>
				<div class="controls">
					<g:field type="number" name="code" required="" value="${departmentInstance.code}"/>
					<span class="help-inline">${hasErrors(bean: departmentInstance, field: 'code', 'error')}</span>
				</div>
			</div>

			<div class="control-group fieldcontain ${hasErrors(bean: departmentInstance, field: 'name', 'error')} ">
				<label for="name" class="control-label"><g:message code="department.name.label" default="Name" /></label>
				<div class="controls">
					<g:textField name="name" value="${departmentInstance?.name}"/>
					<span class="help-inline">${hasErrors(bean: departmentInstance, field: 'name', 'error')}</span>
				</div>
			</div>

			<div class="control-group fieldcontain ${hasErrors(bean: departmentInstance, field: 'subjects', 'error')} ">
				<label for="subjects" class="control-label"><g:message code="department.subjects.label" default="Subjects" /></label>
				<div class="controls">
					
<ul class="one-to-many">
<g:each in="${departmentInstance?.subjects?}" var="s">
    <li><g:link controller="subject" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="subject" action="create" params="['department.id': departmentInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'subject.label', default: 'Subject')])}</g:link>
</li>
</ul>

					<span class="help-inline">${hasErrors(bean: departmentInstance, field: 'subjects', 'error')}</span>
				</div>
			</div>

